package com.burns.strawberry.controller;/**
 * Created by burns.
 *
 * @author <a href="http://www.esoon-soft.com/">burns</a>
 * @date 2020/12/08 22:28
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jms.Queue;

/**
 * @ClassName QueueController
 * @Description 消息队列控制器
 * @Author Burns
 * @DAte 2020/12/8 22:28
 * @Version 1.0
 **/
@RestController
public class QueueController {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    @Autowired
    private Queue queue;

    @RequestMapping("/send")
    public void send(){
        //指定消息发送的目的地及内容
        this.jmsMessagingTemplate.convertAndSend(this.queue,"新发送的消息！");
    }



}
